<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
  <title>load_test_data (MywikiController)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
  <pre><span class="ruby-comment cmt"># File app/controllers/mywiki_controller.rb, line 228</span>
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">load_test_data</span>
        <span class="ruby-value">1</span>.<span class="ruby-identifier">upto</span>(<span class="ruby-value">20</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">n</span><span class="ruby-operator">|</span> 
                <span class="ruby-ivar">@mywiki</span> = <span class="ruby-constant">Mywiki</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">:all</span>, <span class="ruby-identifier">:conditions</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;title='TestTitle&quot;</span><span class="ruby-operator">+</span><span class="ruby-identifier">n</span>.<span class="ruby-identifier">to_s</span><span class="ruby-operator">+</span><span class="ruby-value str">&quot;'&quot;</span>)
                <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@mywiki</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
                        <span class="ruby-ivar">@mywiki</span> = <span class="ruby-constant">Mywiki</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">:title</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'TestTitle'</span><span class="ruby-operator">+</span><span class="ruby-identifier">n</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">:tags</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'tags'</span><span class="ruby-operator">+</span><span class="ruby-identifier">n</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">:description</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'test desc'</span><span class="ruby-operator">+</span><span class="ruby-identifier">n</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">:body</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">'test body '</span><span class="ruby-operator">+</span><span class="ruby-identifier">n</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">:userid</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span>);                  
                        <span class="ruby-ivar">@mywiki</span>.<span class="ruby-identifier">save</span>
                <span class="ruby-keyword kw">end</span>
        }
        <span class="ruby-identifier">redirect_to</span> <span class="ruby-identifier">:action</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">:help</span>
  <span class="ruby-keyword kw">end</span></pre>
</body>
</html>